using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Warranty.Core.Domain;
using Warranty.Core.IService;
using FX.Data;
using NHibernate;

namespace Warranty.Core.ServiceImp
{
    public class StaffService: BaseService<Staff ,int>,IStaffService
    {
        ISession _mySession;
        public StaffService(string sessionFactoryConfigPath)
            : base(sessionFactoryConfigPath)
        {}
        public IList<Staff> Get_All()
        {
            using (_mySession = NHibernateSession.SessionFactory.OpenSession())
            {
                IList<Staff> query = _mySession.CreateQuery("FROM Staff")
                    .List<Staff>();

                if (query.Count > 0)
                {
                    return query.ToList();
                }
                return null;
            }
        }
    }

}